package by.bucha.tabnavigationproject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.support.v4.app.Fragment;
import by.bucha.tabnavigationproject.tabsframework.AbstractTabActivity;

import com.actionbarsherlock.app.ActionBar;

import fragments.FirstListFragment;
import fragments.SecondListFragment;

public class MainActivity extends AbstractTabActivity {

	public void addTab(final String title, final Fragment fragment) {
		final ActionBar.Tab tab = getSupportActionBar().newTab();
		tab.setText(title);
		addTab(tab, fragment);
	}

	@Override
	public void createTabs() {
		List<Fragment> startFragments = getStartFragments();
		addTab("first", startFragments.get(0));
		addTab("second", startFragments.get(1));
	}

	@Override
	public List<Fragment> getStartFragments() {
		List<Fragment> startFragments = new ArrayList<Fragment>();

		startFragments.add(new FirstListFragment());
		startFragments.add(new SecondListFragment());

		return startFragments;
	}
}
